<template>
	<view class="Menu">
		<!-- 导航条 :style="{ height: $wanlshop.wanlsys().height + 'px' }"-->
		<view class="cu-custom">
			<view class="cu-bar fixed bg-bgcolor"
				:style="{height: $wanlshop.wanlsys().height + 'px',paddingTop: $wanlshop.wanlsys().top + 'px',}">
				<view class="action">
					<text class="wlIcon-fanhui1" style="margin-left: 0" @tap="$wanlshop.back(1)"></text>
				</view>
				<view class="content" :style="{ top: $wanlshop.wanlsys().top + 'px' }">
					<!-- 我的业绩 -->
					{{$t('pageStock3.page-title')}}
				</view>

				<view class="action">
					<text class="wlIcon-gengduo"></text>
				</view>
			</view>
		</view>
		<z-paging ref="paging" v-model="dataList" class="listbox" @query="getDataList" default-page-size="15">
			<view slot="top">
				<!-- 内容 -->
				<view class="cardBox" v-if="dateDetail">
					<view class="card">
						<view class="money">{{dateDetail.sum_money}}</view>
						<view class="all">{{$t('pageStock3.tips-qbqy')}}<!-- 全部权益 --></view>
						<view class="jf">
							<view class="cardline">
								{{$t('pageStock3.tips-zyjf')}}
								<!-- 占用算力 -->
								<view class="num">{{dateDetail.freeze_money}}</view>
							</view>
							<view class="line"></view>
							<view class="cardline">
								{{$t('pageStock3.tips-kyjf')}}
								<!-- 可用算力 -->
								<view class="num">{{dateDetail.money}}</view>
							</view>
						</view>
					</view>
				</view>
				<view class="details">
					<!-- 算力明细 -->
					{{$t('pageStock3.block-title.jfmx')}}
					<view style="display: flex">
						<!-- <view class="extract" @click="Transfer">{{$t('pageStock3.but.hz')}}</view> -->
						<!-- <view class="extract" @click="transaction">交易</view> -->
						<view class="extract" @tap="$wanlshop.auth('/pages/newPage/recharge')">
							{{$t('pageStock3.but.cz')}}
						</view>
						<!-- <view class="extract" @tap="$wanlshop.auth('/pages/user/money/withdraw')">
							{{$t('pageStock3.but.tx')}} 
						</view> -->
					</view>
				</view>
			</view>
			<view class="list" v-for="(item,index) in dataList" :key="index">
				<view class="listLeft">
					<view class="name">{{item.memo}}</view>
					<view>{{item.createtime}}</view>
				</view>
				<view class="listRight">{{item.money>0?"+":""}} {{item.money}}</view>
			</view>
		</z-paging>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				dataList: [],
				dateDetail: null
			};
		},
		methods: {
			getDataList(pageNo, pageSize) {
				uni.request({
					url: "/wanlshop/pay/moneyLogOne",
					method: "POST",
					data: {
						page: pageNo
					},
					// 1.1.8 升级
					success: (res) => {
						if (res.res.code == 1) {
							this.dateDetail = res.res.data
							this.$refs.paging.complete(res.res.data.list.data);
						}
					},
					fail() {
						this.$refs.paging.complete(false);
					}
				});
			},
			//转账
			Transfer() {
				this.$wanlshop.to("/pages/newPage/transfer");
			},
		}
	};
</script>

<style lang="scss">
	.Menu {
		background: #f8f8f8;

		.cardBox {
			padding: 0 24rpx;
		}

		.card {
			width: 100%;
			height: 294rpx;
			background: url("../../static/images/index/gupiao.png") no-repeat;
			background-size: 100% 100%;
			margin-top: 40rpx;
			text-align: center;
			color: #fff;
			font-size: 28rpx;
		}

		.jf {
			margin-top: 20rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;
		}

		.money {
			font-size: 60rpx;
			padding-top: 30rpx;
		}

		.all {
			margin-top: 10rpx;
		}

		.line {
			width: 2rpx;
			height: 90rpx;
			background: #fff;
		}

		.cardline {
			flex: 1;

			.num {
				font-weight: 600;
				font-size: 40rpx;
				color: #ffffff;
			}
		}

		.details {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 24rpx;
			margin-top: 28rpx;
			color: #666666;

			.extract {
				padding: 10rpx 20rpx;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				border: 2rpx solid #e34544;
				font-weight: 400;
				font-size: 28rpx;
				color: #e34544;
				margin-left: 20rpx;
			}
		}

		.listbox {
			background: #fff;
			padding: 0 24rpx;
			margin-top: 34rpx;

			// min-height:65vh;
			.list {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-top: 40rpx;
				padding-bottom: 40rpx;

				.listLeft {
					font-weight: 400;
					font-size: 24rpx;
					color: #999999;

					.name {
						font-size: 28rpx;
						color: #333333;
						margin-top: 10rpx;
					}
				}

				.listRight {
					font-weight: 400;
					font-size: 32rpx;
					color: #e34544;
				}
			}
		}
	}
</style>